<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="lushu">
		<title>脱机交易日结复核</title>
		<script type="text/javascript" src="../script/common.js" language="JavaScript"></script>
		<script type="text/javascript" language="javascript" src="../script/common_stat.js"></script>
		<script type="text/javascript" language="JavaScript">
			var Page;					//数据表格对象

			function initPageElements(){
				Page.sql = "daily_list_station";
				Page.tradeType = [150,153];//报表交易类型
				Page.DEFAULT_CUTOFF = 1;		//默认截止日期,昨天
				Page.DEFAULT_INTERNAL = 2;		//默认日期范围
				//Page.selection.status.defCode = DailyCheckStatus.UNCHECKED;	//默认显示未复核
				Page.columns[5] = {render:
					function(v,r){
						var s = "<a href=# onclick=\"Clear.MatchResult.showDetail('"
								+ r[2].id+"');return false;\">"+v+"<\/a>";
						return s;
					}
				};
				
				Page.checkable = function(r){
					if (r[2].status!=MatchResultStatus.OK)
						return false;
					return Clear.DailyCheck.checkOrgAuthority(r[0].status,r[0].type,r[1]);
				}
				Page.showPivot = function(param){
					DWR.call("crosstabService.statData",
							 "daily_check_station",
							 "accountType;tradeType;cardUserType;cardUserLevel;cardType",//;bank;goodsCategory
							 "tradeStatus|sum;count",
							 param,
							 function(obj){
								Page.crosstab.setData(obj);
								Page.crosstab.show('pivotTable')
								switchPage("pivotView");
							}
					);
					DWR.call("crosstabService.statData",
							 "ppstrade_station",
							 "accountType;tradeType;status;errorCode",
							 "|absSum;count",
							 param,
							 function(obj){
							 	var c = new Crosstab();
								c.setData(obj);
								c.show('errorPivotTable');
							}
					);
				}
				Page.doQuery = function(){
					ListPage.showListTable();
				}
			}
		</script>
	</head>
	<body onload="Clear.DailyCheck.init()">
		<div class="nav"><div id="nav">&nbsp;</div></div>
		<div id="listView">
			<div class="searchForm">
				<form id="searchForm" name="searchForm">
					<table cellSpacing="0" cellPadding="4" width="100%" border="0">
						<tr>
							<td class="label4" id="acquirer"></td>
							<td>
								<label>复核状态</label>
								<select name="status"><option></option></select>
							</td>
						</tr>
						<tr>
							<td id="beginDateTd"></td>	
							<td id="endDateTd"></td>
							<td><button onclick="Page.doQuery();">查 询</button></td>
						</tr>
					</table>
				</form>
			</div>
			<div id="datalist"></div>
		</div>
		
		<div id="pivotView" style="display:none">
			<div id='printArea' class="form">
				<div id="dailycheckStatus" class="formTitle"></div>
				<table width="80%" border="0" cellspacing="0" cellpadding="5" style="width:600">
					<tr>
						<td align="center" class="reportTitle" height="50" colspan="2">
							加油站正常入帐交易统计报表
						</td>
					</tr>
					<tr>
						<td width="67%">统 计 人：<span id="statoper"></span></td>
						<td>统计机构：<span id="statorg"></span></td>
					</tr>
					<tr>
						<td>业务日期：<span id="statBusinessDate"></span></td>
						<td>统计时间：<span id="statTime"></span></td>
					</tr>
				</table>
				<div align='center' id='pivotTable'></div>
				
				<table width="80%" border="0" cellspacing="0" cellpadding="5" style="width:600">
					<tr>
						<td align="center" class="reportTitle" height="50" colspan="2">
							加油站异常交易统计报表
						</td>
					</tr>
					<tr>
						<td width="67%"></td>
						<td>统计条件同上表</td>
					</tr>
				</table>
				<div align='center' id='errorPivotTable'></div>
			</div>
			<p>
				<button id="checkBtn">确认复核</button>
				<button onclick="WebPrint.preview('printArea')">打印预览</button>
				<button onclick="WebPrint.print('printArea')">打印</button>
				<button onclick="Clear.DailyCheck.goFirstPage();">返 回</button>
			</p>
		</div>
		
		<div id="detailView" style="display:none;>
			<form id="viewForm" name="viewForm" class="label5 viewTable">
				<div class="form">
					<div class="formTitle">对帐明细</div>
					<div id="matchResultDetail"></div>
				</div>
				<p><button onclick="Clear.DailyCheck.goFirstPage();">返 回</button></p>
			</form>
		</div>
	</body>
</html>